home *** CD-ROM | disk | FTP | other *** search
- import javax.microedition.lcdui.Graphics;
- import javax.microedition.lcdui.Image;
-
- public class AutoSprite {
- public static final int ACTIVE = 0;
- public static final int DESTROYED = 1;
- // $FF: renamed from: UP boolean
- public static final boolean field_0 = true;
- public static final boolean DOWN = false;
- // $FF: renamed from: x int
- private int field_1;
- // $FF: renamed from: y int
- private int field_2;
- // $FF: renamed from: dx int
- private int field_3;
- // $FF: renamed from: dy int
- private int field_4;
- private int xMax;
- private int yMax;
- private Image[] image;
- private int[][] sequenceFrame;
- private int index;
- private int state;
- private String name;
- private int delay = 0;
- private int animationDelay = 0;
-
- public AutoSprite(int var1, int var2, String var3) {
- this.xMax = var1;
- this.yMax = var2;
- this.name = var3;
- this.state = 0;
- }
-
- public void draw(Graphics var1) {
- var1.drawImage(this.image[this.index], this.field_1, this.field_2, 20);
- }
-
- public int getDx() {
- return this.field_3;
- }
-
- public int getDy() {
- return this.field_4;
- }
-
- public Image getImage(int var1) {
- return this.image[var1];
- }
-
- public int getIndex() {
- return this.index;
- }
-
- public int getState() {
- return this.state;
- }
-
- public int getX() {
- return this.field_1;
- }
-
- public int getY() {
- return this.field_2;
- }
-
- public void setAnimationDelay(int var1) {
- this.animationDelay = var1;
- this.delay = var1;
- }
-
- public void setDx(int var1) {
- this.field_3 = var1;
- }
-
- public void setDy(int var1) {
- this.field_4 = var1;
- }
-
- public void setImage(Image[] var1) {
- this.image = var1;
- }
-
- public void setIndex(int var1, int var2) {
- this.index = this.sequenceFrame[var1][var2];
- }
-
- public void setSequenceFrame(int var1, int var2, int[][] var3) {
- this.sequenceFrame = new int[var1][var2];
- this.sequenceFrame = var3;
- }
-
- public void setState(int var1) {
- this.state = var1;
- }
-
- public void setX(int var1) {
- this.field_1 = var1;
- }
-
- public void setY(int var1) {
- this.field_2 = var1;
- }
-
- public void tick(boolean var1) {
- if (var1) {
- if (this.delay == this.animationDelay) {
- this.field_2 -= this.field_4;
- if (this.field_2 < this.yMax) {
- this.state = 1;
- }
-
- this.delay = 0;
- }
-
- ++this.delay;
- } else if (!var1) {
- if (this.delay == this.animationDelay) {
- this.field_2 += this.field_4;
- if (this.field_2 > this.yMax) {
- this.state = 1;
- }
-
- this.delay = 0;
- }
-
- ++this.delay;
- }
-
- }
-
- public String toString() {
- return this.name;
- }
- }
-